package com.r2coding.system.dao;

import com.r2coding.system.entity.PermissionEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.r2coding.system.model.RolePermissionModel;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 
 * 
 * @author 98k灬
 * @email hk666zx@163.com
 * @date 2022-04-04 11:10:29
 */
@Mapper
public interface PermissionDao extends BaseMapper<PermissionEntity> {

    void saveRolePermission(RolePermissionModel model);

    void removePermissionByRoleId(@Param("roleId") Integer roleId);

    List<RolePermissionModel> getPermissionIdsByRoleId(@Param("roleId") Integer roleId);

    List<PermissionEntity> getPermissionsByUserId(@Param("userId") Integer userId);
}
